class Person:
    '''Person definition:'''
    population = 0

    def __init__(self, name = 'yx'):
        self.name = name
        print 'init %s' % self.name, self
        Person.population += 1

    def __del__(self):
        print '%s says bye.' % self.name
        self.__class__.population -= 1
        print '%d people left' % self.__class__.population

    def sayHi(self):
        print "hi, my name is %s" % self.name

    def howMany(self):
        print '%d people here' % Person.population

p = Person('yangxin')
p.sayHi() 
p.howMany()

q = Person('xiongxiong')
q.sayHi()
q.howMany()

p.sayHi()
p.howMany()

print 'namespace:',dir()
